<template>
  <el-dialog
    class="public-dialog"
    :title="dialogtitle"
    :modelValue="modelValue"
    @close="handleClose"
    draggable
    align-center
    destroy-on-close
    width="400"
  >
    <div class="pb-[24px] text-center">
      <p v-for="i in list" :key="i">{{ i }}</p>
    </div>
  </el-dialog>
</template>

<script setup>
const modelValue = ref(false);
const list = ref([]);
const handleClose = async (refresh) => {
  list.value = [];
  modelValue.value = false;
};
const dialogtitle = ref("");
const open = ({ data, title }) => {
  console.log(title);
  modelValue.value = true;
  list.value = data;
  dialogtitle.value = title;
};
defineExpose({
  open,
});
</script>
